/*******************************************************************************
Title: Individualism during Crisis 
Authors: Bo Bian, Jingjing Li, Ting Xu, Natasha Z. Foutz
Purpose: Produce the following tables
         - Appendix Table A13
*******************************************************************************/

clear all
set more off
set matsize 5000
cap log close
set linesize 200

log using "tables\rep_A13", replace
use "data\rep_atus.dta", clear

lab var shr_Tact_home_serv "share of time spent at home for all activities (except sleep, work, or education) out of all time spent on these activities"
lab var shr_Tact_home11 "share of time spent on eating and drinking activities at home out of all time spent on these activities"
lab var shr_Tact_home12 "share of time spent on socializing and leisure activities at home out of all time spent on these activities"
codebook fips

* columns (1), (2), and (3) 
eststo clear
foreach y in shr_Tact_home_serv shr_Tact_home11 shr_Tact_home12  {
	eststo `y': quietly reghdfe `y' tfe_bin, ab(gestfips#hryear4 hrhtype) cl(fips)
	qui estadd ysumm, mean 
}
esttab shr_Tact_home_serv shr_Tact_home11 shr_Tact_home12, scalars(ymean) ar2 star(* 0.1 ** 0.05 *** 0.01) b(3) se(3) br mtitle title(Table A13 columns (1)-(3)) replace

* columns (4), (5), and (6) 
foreach y in shr_Tact_home_serv shr_Tact_home11 shr_Tact_home12  {
	eststo `y'_ctrl: quietly reghdfe `y' tfe_bin family_size, ab(gestfips#hryear4 hrhtype hefaminc peeduca) cl(fips)
	qui estadd ysumm, mean 
}
esttab shr_Tact_home_serv_ctrl shr_Tact_home11_ctrl shr_Tact_home12_ctrl, scalars(ymean) ar2 star(* 0.1 ** 0.05 *** 0.01) b(3) se(3) br mtitle title(Table A13 columns (4)-(6))  replace

log close